const fs = require("fs");
const path = require("path");
fs.readFile(path.join(__dirname, "code/成绩.txt"), "utf8", (err, data) => {
  if (err) return console.log("读取文件失败" + err.message);
  const arrADD = data.split(" ");
  const star = [];
  arrADD.forEach((item) => {
    star.push(item.replace("=", ":"));
  });
  //   const Arradd = star.join("\r\n");
  let strs = data.replace(/[=]/g, ":").replace(/[ ]/g, "\n");
  fs.writeFile(__dirname + "code/新成绩.txt", strs, (err) => {
    if (err) return console.log("写入文件失败" + err.message);
    console.log("写入文件成功");
  });
});
